﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LogException.Dominio.Repositorios;
using LogException.Dominio.MantisService;

namespace LogException.InfraEstrutura
{
    public class RepositorioMantis : IMantis
    {
        private MantisConnectPortTypeClient servico;
        private string _numeroIssue;
        private string _echo;

        public RepositorioMantis() 
        {
            servico = new MantisConnectPortTypeClient();
        }

        public string AdicionaLog(string usuario, string senha , LogException.Dominio.MantisService.IssueData issue)
        {
            servico.Open();
            _numeroIssue =  servico.mc_issue_add(usuario, senha, issue);
            servico.Close();
            return _numeroIssue;
        }

        public string Echo()
        {
            servico.Open();
            _echo = servico.mc_version();
            servico.Close();
            return _echo;
        }
    }
}
